﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hawayel.RFC.Engine.DataStructures;
using System.IO;

namespace Hawayel.RFC.Engine
{
    /// <summary>
    /// 
    /// </summary>
    public class Validator
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="ps"></param>
        /// <returns></returns>
        public ErrorCode Validate(ProcessSettings ps)
        {
            //.
            if (null == ps)
            {
                return ErrorCode.EmptySettings;
            }

            //.
            if (string.IsNullOrWhiteSpace(ps.SourceFolder))
            {
                return ErrorCode.EmptySourcePath;
            }
            if(false == Directory.Exists(ps.SourceFolder))
            {
                return ErrorCode.InvalidSourcePath;
            }

            //.
            if (string.IsNullOrWhiteSpace(ps.DestinationFolder))
            {
                return ErrorCode.EmptyDestination;
            }
            if (false == Directory.Exists(ps.DestinationFolder))
            {
                return ErrorCode.InvalidDestinationPath;
            }

            //.
            return ErrorCode.None;
            
        }
    }
}
